learn (someone's) lesson

Translations
retenir la leçon
Definitions
To gain understanding or insight from a past experience, often one that was difficult or unpleasant, leading to a change in behavior or attitude.